package com.fit.pages;

import java.util.Date;

import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.SessionState;

import com.fit.annotations.AdminAccess;
import com.fit.annotations.UserAccess;
import com.fit.services.BasicAuthenticator;

/**
 * Start page of application TouristicAgency.
 */
@AdminAccess
@UserAccess
public class Index {

	@SessionState
	@Property
	private BasicAuthenticator basic;

	public Date getCurrentTime() {
		return new Date();
	}

	public boolean isAdmin() {
		if (basic.getLoggedUser().getType().equalsIgnoreCase("admin")) {
			return true;
		}
		return false;
	}

}
